package homework.test1;

public class SiYangYuan {
    public void yangAnimals(Animal animal){
        animal.drink();
        animal.eat();

        if(animal instanceof Dog){
            Dog dog = (Dog) animal;
            dog.swim();
        } else if (animal instanceof Fog) {
            Fog fog = new Fog();
            fog.swim();
        }

    }
}
